#!/usr/bin/python
# GM_simulationparameters.py
'''Lists simulation parameters used by modules of the GalacticModel program.

These parameters are likely to be altered from run to run.'''

# If the running environment is a cluster, use True
isacluster = False
# List of permitted nodes to use for computation.  If all are allowed, use ['9999']
nodes = ['9999']
# DIRECTORY NAMES MUST BEGIN AND END WITH /

if isacluster == True:
    # Full pathname to code
    codedir = "/nethome/afournier/GalacticModel/" # Desktop, Cluster
    # Full path to output directory
    outdir = "/science/afournier/GalacticModel/Output/" # Cluster
else:
    # Full pathname to code
    codedir = "/Users/Amanda/Desktop/GalacticModel/" # Laptop
    # Full path to output directory
    outdir = "/Users/Amanda/Desktop/GalacticModel_Output/" # Laptop
#outdir = "/nethome/afournier/GalacticModel/Output/" # Desktop
# Full path to python, including python (this will only be called if used on a cluster)
pydir = "/opt/epd/bin/python" # Desktop, Cluster
# No. points one dimension of cartesian grid. NOW IRRELEVANT
Nptsxy = 100
# Radius to which model extends, in kpc
#scale = 16
scale = 12
# That 'scale' you just gave me - did you mean the galactic radius to which the simulation extends, or the heliocentric radius to which the model extends?  If 'True', a cutoff at a fixed galactocentric radius will be enforced, regardless of actual distance from the sun.  If 'False', the only cutoff will be absolute distance from the sun.
galactocentric = True # Not yet implemented
# Should we use the updated/recent IMF and LF values (low-mass end only) from Bochanski et al. 2010?
Bochanski2010IMFandLF = False
# Do you want the r band ('Bo_r') or J band ('Bo_J') luminosity function?  Only used if Bochanski2010IMFandLF is True.
BoBand = 'Bo_r'
# Do you want the 'system' mass function & luminosity function, or the single star mass function and luminosity function?  The system LF may be most appropriate for determining whether star counts are correctly matched, whereas the single MF & LF may provide the most accurate estimates of lensing optical depth.
#Only used if Bochanski2010IMFandLF is True.
system_or_single = 'system'
# Magnitude a lensing event must reach to be counted. To not limit, choose a large number, like 1000.
LensedMag = 12 # Not yet implemented
# Magnitude the unmagnified source must have for a lensing event to be counted
SourceMag = [12, 14, 16, 18, 20, 22]
#SourceMag = [12, 14, 16, 18]
#SourceMag = [12, 13]
# Limiting lensing strength, as a multiplicative factor
Magnification = 1.34 # Not yet implemented
# What is the brightest unlensed apparent magnitude you wish to consider as a potential lensing source?  Will be rounded.
brightlimit = 6
# Desired resolution elements in l, b, and d (if greater than 'true' resolution, will look funny)
# Note: Since l stretches over a greater angular range than b, with the same 'resolution' it is less finely sampled
dres = 100
#dres = 100
lres = 3
bres = 5
# Do you want to use V band star counts (band = 'V') or I band star counts (band = 'I') to determine the number of stars you should have?  Note that if Bochanski2010IMFandLF is True, this will be overwritten by BoBand.
band = 'V'
# c0 determines the strength of extinction; it combines information about dust density, composition, and cross section and is, for our purposes, an arbitrary constant
# rho0 determines the overall density of bright stars
# These are only first-guesses (unless you set fitcrho to False), but of course you will profit if your first guesses are 'reasonable' values
# Note that because I only have local population counts for the visual magnitudes of stars, c0_I & rho0_I relate the local V band population to the I band star counts, which is probably a poor way of doing things; this option is available but not strongly recommended
c0_I = 0.11496
rho0_I = 3.5722
# Chosen with free fit in rho0, c0 for intervals 1
#c0_V = 0.16154
#rho0_V = 2.0135
# Chosen arbitrarily.
#c0_V = 0.05
#rho0_V = 1.
# Chosen w/ free rho0,c0, latitudeweight=1., intervals=4, precision 1.004
c0_V = 0.49687
rho0_V = 3.0180
# Chosen with free fit in rho0, c0 for intervals 4, precision 1.004
#c0_V = 0.16043
#rho0_V = 2.3802
# Chosen with free fit in rho0, c0 for intervals 2, precision *~1.33
#c0_V = 0.16581
#rho0_V = 2.7603
# Chosen with fit with fixed rho0, free c0 for intervals 1
#c0_V = 0.16052
#rho0_V = 1.
# AMANDA'S NOTE: The values for c0 and rho0 above are the product of a four-iteration fit and are accurate (given assumptions, and unless otherwise stated) to within a multiplicative or divisive factor of 1.009.
# So... do you want to fit c0 and rho0?
fitcrho = False
# If fitcrho = True, you have the option to hold either c0 or rho0 fixed.
fixedrho = False
fixedc = False
# If fitcrho = True, you have the option to weight the star counts at high latitudes more than the star counts at low latitudes.  (This is probably advisable.)  A value of 0 means all latitudes are weighted equally; a value of 1 means that star counts at latitude zero receive zero weight.  latitudeweight MUST be between 0 and 1.
# NOTE that this is IN ADDITION to the "natural" or internal weighting, determined by the angular area represented by each data point
latitudeweight = 1.
# Interpolate to find a more finely spaced grid of actual and apparent magnitudes?
interpolateMv = True
# How many intervals in a magnitude? A value of four means each magnitude bin will be 0.25 magnitudes wide. This will apply to both "intrinsic" and "apparent" distributions generated.
intervals = 4
# To what limits in apparent magnitudes do you wish to calculate the apparent distribution of stars?
# Note that this is used for generating lensing rates, but not for fitting the appropriate density multiplier or dust absorption coefficient
ApparentLimits = [6, 23]
#ApparentLimits = [12, 25]
# Do you want to fill in some of the gaps in MvMass? (Of course you do.)
interpolateMass = True
# What's the biggest step you want to allow in mass, in Msun?
maxmassinterval = 1

# Do you want the rate near a single pointing?
# BE WARNED, this is not what you will generally want!  blocs and llocs will be forced to 1 without any further intervention from you.  The answer you get out will be given in [usual units * per square degree].
pencilBeam = True
# Coordinates of that pointing [l, b] in degrees
pencilBeamPointing = [21.272, -13.340] # pointing for Ruprecht 147 in Galactic

# Want a Monte Carlo timescale distribution?
timescales = True
# How many points do you want, minimum?  Must be positive.  The code may give you a larger number of points at its own convenience.
NtRequested = 10000
# A "buffer factor".  Must be positive.  Making this larger makes it less likely that the code will give you a too-small number of timescale values by chance; it may also increase the code's workload.  I recommend a value of order a few thousand.  If you get fewer timescales than you wanted or expected, increase bufferfactor and try again.
bufferfactor = 2000

# Want to include a cluster?
starcluster = False # Not fully in yet!
